package com.fansl.koala.quickdev.module.koala.service.impl;

import cn.hutool.core.util.StrUtil;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fansl.koala.quickdev.module.koala.entity.User;
import com.fansl.koala.quickdev.module.koala.mapper.UserMapper;
import com.fansl.koala.quickdev.module.koala.service.IUserService;
import org.springframework.stereotype.Service;

/**
 * @author fansl
 * @Description: TODO
 * @date 2020/5/6 11:18
 */
@Service
@DS("koala_users")
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {
    /**
     * 根据手机号获取学生id
     *
     * @param tel 手机号
     * @return 学生id
     */
    @Override
    public Long getStudentIdByTel(String tel) {
        if (StrUtil.isBlank(tel)) {
            return 0L;
        }
        return baseMapper.getStudentIdByTel(tel);
    }
}
